<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  <style type="text/css">
    .highlight { display: block; background-color: #ddd; }
  </style>
  <script type="text/javascript">
    function highlight() {
      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
    }
  </script>
</head>
<body onload="prettyPrint(); highlight();">
  <pre class="prettyprint lang-js">&lt;?php
namespace Library;

class Error
{
	private $_config;
	private $_bootstrap;
	
	public function __construct($config, \Library\Mvc\Bootstrap $bootstrap)
	{
		$this-&gt;_config = $config;
		$this-&gt;_bootstrap = $bootstrap;
	}
	
	public function displayException(\Exception $exception)
	{
		if ($this-&gt;_bootstrap-&gt;callEvent('applicationError', array($exception)) === false)
		{
			return;
		}
		
		ob_end_clean();
		
		$class = '\\' . $this-&gt;_config['application']['module'] . '\\Controllers\\Error';
		
		$controller = new $class();
		
		$controller-&gt;displayAction($exception);
	}
}</pre>
</body>
</html>
